package com.example.module_patrol.http

import com.example.lib_net.BaseResponse
import com.example.module_patrol.model.PatrolEntity
import com.example.module_patrol.model.PatrolNotDoingEntity
import retrofit2.http.Body


import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Path
import retrofit2.http.Query

interface PatrolApi {
    //"http://10.161.9.80:2209/api/parking-spaces/type/"
    @GET("/api/patrol-points")
    suspend fun getPatrolList(): BaseResponse<List<PatrolEntity>>

    @POST("/api/patrol-points")
    suspend fun addPatrol(@Body patrolEntity: PatrolEntity):BaseResponse<PatrolEntity>

    @GET("/api/patrol-points/search")
    suspend fun searchPatrol(@Query("location")location:String,@Query("name")name:String):BaseResponse<List<PatrolEntity>>

    /*-
     * 获取指定状态的巡察任务
     * 这里是巡检待办
     */
    @GET("/api/patrol-tasks/by-status/{status}")
    suspend fun getPatrolTaskByStatus(@Path("status")status:String):BaseResponse<List<PatrolNotDoingEntity>>

    /*
     * 获取指定id的巡察点
     */
    @GET("/api/patrol-points/{id}")
    suspend fun getPatrolById(@Path("id")id:Int):BaseResponse<PatrolEntity>

    /*
     * 根据时间段的巡察任务
     */
   @GET("/api/patrol-tasks/by-date")
   suspend fun getPatrolTaskByDate(@Query("startDate")startDate:String,@Query("endDate")end:String):BaseResponse<List<PatrolNotDoingEntity>>




}